﻿@using Website.CRUDServices
@{
    ViewBag.Title = "Bruger log";
    this.Layout = "~/Views/_Shared/_Layout.cshtml";
    var users = this.ViewData["Users"] as List<User> ?? new List<User>();

    var selectListUsers = new List<User>();
    //adding empty user as 
    selectListUsers.Add(new User() { ID = Guid.Empty, Name = "" });
    selectListUsers.AddRange(users);
}
<script>
    $(function() {
        $("#HappenedBefore").datepicker();
        $("#HappenedAfter").datepicker();
    });
</script>

<h2>@ViewBag.Title</h2>

@using (this.Html.BeginForm("LogSearchResult", "Admin"))
{
  
    <div class="formBullet">Bruger:</div>
    <div class="formEntry">
        @Html.DropDownList("User", selectListUsers.OrderBy(x => x.Name).Select(x => new SelectListItem{ Value = x.ID.ToString(), Text = x.Name }))
    </div>

    <div class="formBullet">
        Tidsrum:    
    </div>
    <div class="formEntry">
        Fra
        <input type="text" id="HappenedAfter" name="HappenedAfter" readonly="readonly" value="" style="text-align: center; width: 100px;"/>

        til 
        <input type="text" id="HappenedBefore" name="HappenedBefore" readonly="readonly" value=""  style="text-align: center; width: 100px;" />
    </div>


    <div class="buttonHolder"><input type="submit" value="Søg" tabindex="7"/></div>
}